<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<TestBat.Frontend.Controllers.ViewData.Test.Tasks.EssayTaskViewData>" %>

<script type="text/javascript">

    $(function() {
        $("#EssaySolution\\$<%= Model.TestTaskID %>").blur(function() {
            $.ajax( {
                url: "<%=Url.Content("~/Test/SaveEssaySolution") %>",
                data: { testTaskID: "<%=Model.TestTaskID %>", answer: $("#EssaySolution\\$<%= Model.TestTaskID %>").val() }
            });
        });
    });
</script>

<p class="question"><%= Model.Task.Question %></p>
<p class="answer"><%= Html.TextArea("EssaySolution$" + Model.TestTaskID.ToString(), (Model.Solution == null) ? "" : Model.Solution.Text, new { id = "EssaySolution$" + Model.TestTaskID.ToString() })%></p>
